﻿@using System.Threading.Tasks
@using Pgpg.Core.Authorization
@using Pgpg.Web.Areas.Admin.Startup
@using Pgpg.Web.Startup
@{
    ViewBag.CurrentPageName = AdminPageNames.Host.Editions;
}
@section Styles
{
    <environment names="Development">
        <link rel="stylesheet" href="~/view-resources/Areas/Admin/Views/Common/_FeaturesTree.css" asp-append-version="true" />
        <link rel="stylesheet" href="~/view-resources/Areas/Admin/Views/Editions/Index.css" asp-append-version="true" />
    </environment>

    <environment names="Staging,Production">
        <link rel="stylesheet" href="~/view-resources/Areas/Admin/Views/Common/_FeaturesTree.min.css" asp-append-version="true" />
        <link rel="stylesheet" href="~/view-resources/Areas/Admin/Views/Editions/Index.min.css" asp-append-version="true" />
    </environment>
}

@section Scripts
{
    <environment names="Development">
        <script src="~/view-resources/Areas/Admin/Views/Common/_FeaturesTree.js" asp-append-version="true"></script>
        <script src="~/view-resources/Areas/Admin/Views/Editions/_CreateOrEditModal.js" asp-append-version="true"></script>
        <script src="~/view-resources/Areas/Admin/Views/Editions/Index.js" asp-append-version="true"></script>
    </environment>

    <environment names="Staging,Production">
        <script src="~/view-resources/Areas/Admin/Views/Common/_FeaturesTree.min.js" asp-append-version="true"></script>
        <script src="~/view-resources/Areas/Admin/Views/Editions/_CreateOrEditModal.min.js" asp-append-version="true"></script>
        <script src="~/view-resources/Areas/Admin/Views/Editions/Index.min.js" asp-append-version="true"></script>
    </environment>
}
<div class="row margin-bottom-5">
    <div class="col-xs-6">
        <div class="page-head">
            <div class="page-title">
                <h1>
                    <span>@L("Editions")</span> <small>@L("EditionsHeaderInfo")</small>
                </h1>
            </div>
        </div>
    </div>
    <div class="col-xs-6 text-right">
        @if (IsGranted(AppPermissions.Pages_Editions_Create))
        {
            <button id="CreateNewEditionButton" class="btn btn-primary blue"><i class="fa fa-plus"></i> @L("CreateNewEdition")</button>
        }
    </div>
</div>

<div class="portlet light margin-bottom-0">
    <div class="portlet-body">
        <div id="EditionsTable"></div>
    </div>
</div>
